import serve from "../index.js";

// 获取分类
export function getClass() {
  return serve({
    methods: "POST",
    url: "/api/get_cate_list",
  });
}

// 获取文章列表
export function getHomelist(res) {
  return serve({
    method: "POST",
    url: `/api/get_article_list`,
    data: res,
  });
}

// 文章详情
export function getContainer(data) {
  return serve({
    method: "POST",
    url: `/api/get_article_detail?article_id=${data}`,
  });
}

// 搜索
export function getSearch(key_word, skip, limit) {
  return serve({
    method: "POST",
    url: `/api/search?key_word=${key_word}&skip=${skip}&limit=${limit}`,
  });
}

// 收藏文章
export function yesDetail(params) {
  return serve({
    method: "POST",
    url: "/api/add_fav",
    data: params,
  });
}

// 取消收藏文章
export function notDetail(params) {
  return serve({
    method: "POST",
    url: "/api/remove_fav",
    data: params,
  });
}
